import tesserocr

from ldz import image_to_parse

image_to_convert = image_to_parse.convert('L')
image_to_convert.show()
image_to_convert = image_to_parse.convert('1')
image_to_convert.show()
threhold = 50
chart=[]
for i in range(256):
    if i<threhold:
        chart.append(0)
    else:
        chart.append(1)
    image_for_threshold = image_to_convert.point(chart,'1')
    image_for_threshold.show()
text_result = tesserocr.image_to_text(image_for_threshold)
print(text_result)